// #[macro_use]
extern crate lazy_static;

trait StringSplit {
    // add code here
    fn split_once(&self, sep: &str) -> (String, String);
}

impl<'a> StringSplit for &'a str {
    fn split_once(&self, sep: &str) -> (String, String) {
        let mut splitter = self.splitn(2, sep);
        let first = splitter.next().expect("can not split onece");
        let second = splitter.next().expect("can not split onece");
        (first.to_string(), second.to_string())
    }
}

impl StringSplit for String {
    fn split_once(&self, sep: &str) -> (String, String) {
        let mut splitter = self.splitn(2, sep);
        let first = splitter.next().expect("can not split onece");
        let second = splitter.next().expect("can not split onece");
        (first.to_string(), second.to_string())
    }
}
